#include <xen/console.h>
#include <xen/sched.h>
#include <xen/symbols.h>
+#include <asm/debugger.h>
static char namebuf[KSYM_NAME_LEN+1];
console_end_sync();
}
+void show_backtrace_regs(struct cpu_user_regs *regs)
+{
+ console_start_sync();
+
+ show_registers(regs);
+ printk("dar 0x%016lx, dsisr 0x%08x\n", mfdar(), mfdsisr());
+ printk("hid4 0x%016lx\n", regs->hid4);
+ printk("---[ backtrace ]---\n");
+ show_backtrace(regs->gprs[1], regs->lr, regs->pc);
+
+ console_end_sync();
+}
+
void __warn(char *file, int line)
{
ulong sp;
sp = (ulong)__builtin_frame_address(0);
lr = (ulong)__builtin_return_address(0);
-
backtrace(sp, lr, lr);
+
console_end_sync();
}
-
-
#include <xen/serial.h>
#include <xen/gdbstub.h>
#include <xen/console.h>
+#include <xen/shutdown.h>
#include <asm/time.h>
#include <asm/processor.h>
+#include <asm/debugger.h>
#undef DEBUG
void program_exception(struct cpu_user_regs *regs, unsigned long cookie)
{
-#ifdef CRASH_DEBUG
- __trap_to_gdb(regs, cookie);
-#else /* CRASH_DEBUG */
- int recover = 0;
-
- console_start_sync();
-
- show_registers(regs);
- printk("dar 0x%016lx, dsisr 0x%08x\n", mfdar(), mfdsisr());
- printk("hid4 0x%016lx\n", regs->hid4);
- printk("---[ backtrace ]---\n");
- show_backtrace(regs->gprs[1], regs->lr, regs->pc);
-
- if (cookie == 0x200)
- recover = cpu_machinecheck(regs);
+ if (cookie == 0x200) {
+ if (cpu_machinecheck(regs))
+ return;
- if (!recover)
- panic("%s: 0x%lx\n", __func__, cookie);
-
- console_end_sync();
+ printk("%s: machine check\n", __func__);
+ } else {
+#ifdef CRASH_DEBUG
+ if (__trap_to_gdb(regs, cookie) == 0)
+ return;
#endif /* CRASH_DEBUG */
+
+ printk("%s: type: 0x%lx\n", __func__, cookie);
+ show_backtrace_regs(regs);
+ }
+ machine_halt();
}
#include <xen/kernel.h>
#include <xen/sched.h>
#include <xen/perfc.h>
-#include <asm/misc.h>
#include <asm/init.h>
#include <asm/page.h>
#include <asm/powerpc64/procarea.h>
#include <asm/powerpc64/processor.h>
#include <asm/powerpc64/ppc970-hid.h>
+#include "scom.h"
#undef DEBUG
#undef SERIALIZE
--- /dev/null
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Copyright (C) IBM Corp. 2006
+ *
+ * Authors: Jimi Xenidis <jimix@watson.ibm.com>
+ */
+
+#ifndef _ARCH_POWERPC_POWERPC64_SCOM_H_
+#define _ARCH_POWERPC_POWERPC64_SCOM_H_
+
+extern void cpu_scom_init(void);
+int cpu_scom_read(unsigned int addr, unsigned long *d);
+int cpu_scom_write(unsigned int addr, unsigned long d);
+void cpu_scom_AMCR(void);
+
+/* SCOMC addresses are 16bit but we are given 24 bits in the
+ * books. The low oerder 8 bits are some kinda parity thin and should
+ * be ignored */
+#define SCOM_AMC_REG 0x022601
+#define SCOM_AMC_AND_MASK 0x022700
+#define SCOM_AMC_OR_MASK 0x022800
+#define SCOM_CMCE 0x030901
+#define SCOM_PMCR 0x400801
+#define SCOM_PTSR 0x408001
+
+#endif
console_end_sync();
}
-void show_execution_state(struct cpu_user_regs *regs)
-{
- show_registers(regs);
-}
} else {
/* booted by someone else that hopefully has a trap handler */
- trap();
+ __builtin_trap();
}
__start_xen(mbi);
* Authors: Hollis Blanchard <hollisb@us.ibm.com>
*/
-#include <asm/misc.h>
#include <xen/cpumask.h>
#include <xen/smp.h>
#include <asm/flushtlb.h>
+#include <asm/debugger.h>
int smp_num_siblings = 1;
int smp_num_cpus = 1;
#include <xen/sched.h>
#include <asm/processor.h>
#include <asm/current.h>
-#include <asm/misc.h>
+#include <asm/debugger.h>
#define Dprintk(x...) printk(x)
#include <xen/sched.h>
#include <asm/current.h>
#include <asm/uaccess.h>
+#include <asm/debugger.h>
#include <public/xen.h>
#include <public/xencomm.h>
#ifndef _ASM_DEBUGGER_H_
#define _ASM_DEBUGGER_H_
+extern void show_backtrace_regs(struct cpu_user_regs *);
+extern void show_backtrace(ulong sp, ulong lr, ulong pc);
+
+static inline void dump_execution_state(void)
+{
+ ulong sp;
+ ulong lr;
+
+ sp = (ulong)__builtin_frame_address(0);
+ lr = (ulong)__builtin_return_address(0);
+
+ show_backtrace(sp, lr, lr);
+}
+
+static inline void debugger_trap_immediate(void)
+{
+ dump_execution_state();
+ __builtin_trap();
+}
+
+static inline void show_execution_state(struct cpu_user_regs *regs)
+{
+ show_registers(regs);
+}
+
+extern void __warn(char *file, int line);
+#define WARN() __warn(__FILE__, __LINE__)
+#define WARN_ON(_p) do { if (_p) WARN(); } while ( 0 )
+#define unimplemented() WARN()
+
+#define FORCE_CRASH() debugger_trap_immediate()
+
#ifdef CRASH_DEBUG
#include <xen/gdbstub.h>
return vector;
}
-#define debugger_trap_immediate() __asm__ __volatile__ ("trap");
-
#else /* CRASH_DEBUG */
static inline int debugger_trap_fatal(
return vector;
}
-static inline void debugger_trap_immediate(void)
-{
- ulong sp;
- ulong lr;
-
- sp = (ulong)__builtin_frame_address(0);
- lr = (ulong)__builtin_return_address(0);
-
- show_backtrace(sp, lr, lr);
-}
-
#endif /* CRASH_DEBUG */
#endif
#include <xen/config.h>
#include <xen/percpu.h>
#include <xen/types.h>
-#include <asm/misc.h>
/* The current time as shown by the virtual TLB clock. */
extern u32 tlbflush_clock;
+++ /dev/null
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Copyright (C) IBM Corp. 2005
- *
- * Authors: Hollis Blanchard <hollisb@us.ibm.com>
- */
-
-#ifndef _ASM_MISC_H_
-#define _ASM_MISC_H_
-
-static inline void unimplemented(void)
-{
-}
-
-static inline void trap(void)
-{
- asm volatile("trap");
-}
-
-#endif
#include <xen/list.h>
#include <xen/types.h>
#include <xen/mm.h>
-#include <asm/misc.h>
#include <asm/system.h>
#include <asm/flushtlb.h>
#include <asm/uaccess.h>
#ifndef __ASSEMBLY__
#include <xen/config.h>
-#include <asm/misc.h>
#include <asm/cache.h>
#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
struct vcpu;
struct cpu_user_regs;
extern int cpu_machinecheck(struct cpu_user_regs *);
-extern void cpu_scom_init(void);
extern void show_registers(struct cpu_user_regs *);
-extern void show_execution_state(struct cpu_user_regs *);
-extern void show_backtrace(ulong sp, ulong lr, ulong pc);
extern unsigned int cpu_extent_order(void);
extern unsigned int cpu_default_rma_order_pages(void);
extern int cpu_rma_valid(unsigned int log);
extern void flush_segments(void);
extern void dump_segments(int valid);
-/* XXX this could also land us in GDB */
-#define dump_execution_state() BUG()
-
-extern void __warn(char *file, int line);
-#define WARN() __warn(__FILE__, __LINE__)
-#define WARN_ON(_p) do { if (_p) WARN(); } while ( 0 )
-
#define ARCH_HAS_PREFETCH
static inline void prefetch(const void *x) {;}